<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-change-edit" class="form-horizontal" AUTOCOMPLETE="OFF">
        <input name="id" id="id" type="hidden" th:value="${emp.id}"/>
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">工号：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.badge}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">姓名：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.name}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">公司名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.compName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">部门名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.depName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">岗位名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.jobName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">修改信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">职称/资格证书：</label>
                    <div class="col-sm-8">
                        <input id="Title" name="Title" th:value="${emp.Title}" class="form-control"  type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">是否最高职称：</label>
                    <div class="col-sm-8">
                        <select name="ishigh" id="ishigh" class="form-control m-b">
                            <option value="">请选择</option>
                            <option value="0" th:selected="${emp.ishigh == 0}">否</option>
                            <option value="1" th:selected="${emp.ishigh == 1}">是</option>
                        </select></div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">注册单位：</label>
                    <div class="col-sm-8">
                        <input id="registerunit" name="registerunit" th:value="${emp.registerunit}" class="form-control"  type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">获得日期：</label>
                    <div class="col-sm-8">
                        <input id="EffectDate" name="EffectDate" th:value="${emp.EffectDate}" class="form-control laydate-demo-1"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">证书编号：</label>
                    <div class="col-sm-8">
                        <input id="CertNo" name="CertNo" th:value="${emp.CertNo}" class="form-control"  type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">转注日期：</label>
                    <div class="col-sm-8">
                        <input id="changeregtime" name="changeregtime" th:value="${emp.changeregtime}" class="form-control laydate-demo-2"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "bgInfo/title";

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });
        });

    });


    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-change-edit").serializeArray();
            var id = $("#id").val();
            var Title = $("#Title").val();
            var ishigh = $("#ishigh").val();
            var registerunit = $("#registerunit").val();
            var EffectDate = $("#EffectDate").val();
            var CertNo = $("#CertNo").val();
            var changeregtime = $("#changeregtime").val();

            data.push({"name": "id", "value": id});
            data.push({"name": "Title", "value": Title});
            data.push({"name": "ishigh", "value": ishigh});
            data.push({"name": "registerunit", "value": registerunit});
            data.push({"name": "EffectDate", "value": EffectDate});
            data.push({"name": "CertNo", "value": CertNo});
            data.push({"name": "changeregtime", "value": changeregtime});
            $.operate.save(prefix + "/edit", data);
        }
    }

</script>
</body>
</html>
